{% extends 'base.html' %}
{% block title %}扫描任务{% endblock %}
{% block subtitle %}<span class="label label-primary" style="margin-left:20px">{{tasks.name}} </span>

<p><code style="font-size:10%;float:right;">{{tasks.starttime}} to {{tasks.endtime}}</code></p>

{% endblock %}
{% block javascript %}
<script type="text/javascript" src="{{url_for('static',filename='js/jquery-1.11.0.min.js')}}"></script>
<script type="text/javascript" src="{{url_for('static',filename='lib/jqueryui/js/jquery-ui-1.10.4.custom.min.js')}}"></script>
<script type="text/javascript" src="{{url_for('static',filename='js/bootstrap.min.js')}}"></script>
<script type="text/javascript" src="{{url_for('static',filename='lib/datatables/js/jquery.dataTables.min.js')}}"></script>
<script type="text/javascript" src="{{url_for('static',filename='lib/datatables/TableTools/js/TableTools.min.js')}}"></script>
<script type="text/javascript" src="{{url_for('static',filename='lib/datatables/bootstrap/3/dataTables.bootstrap.js')}}"></script>
<script type="text/javascript" src="{{url_for('static',filename='js/datatables.js')}}"></script>
<script type="text/javascript" src="{{url_for('static',filename='lib/customscroll/jquery.mCustomScrollbar.concat.min.js')}}"></script>
<script type="text/javascript" src="{{url_for('static',filename='lib/jquery-easing/jquery.easing.1.3.js')}}"></script>
<script type="text/javascript" src="{{url_for('static',filename='lib/offlinejs/offline.min.js')}}"></script>
<script type="text/javascript" src="{{url_for('static',filename='js/script.js')}}"></script>

{% endblock %}
{% block css %}
<link rel="stylesheet" href="{{url_for('static',filename='css/bootstrap.min.css')}}">
<link rel="stylesheet" href="{{url_for('static',filename='lib/offlinejs/themes/offline-theme-dark.css')}}">
<link rel="stylesheet" href="{{url_for('static',filename='css/bootstrap-override.css')}}">
<link rel="stylesheet" href="{{url_for('static',filename='css/font-awesome.min.css')}}">
<link rel="stylesheet" href="{{url_for('static',filename='css/layout.css')}}">
<link rel="stylesheet" href="{{url_for('static',filename='css/library.css')}}">
<link rel="stylesheet" href="{{url_for('static',filename='css/style.css')}}">
<link rel="stylesheet" href="{{url_for('static',filename='lib/offlinejs/themes/offline-theme-dark.css')}}">
<link rel="stylesheet" href="{{url_for('static',filename='lib/datatables/bootstrap/3/dataTables.bootstrap.css')}}">
<link rel="stylesheet" href="{{url_for('static',filename='lib/datatables/TableTools/css/TableTools.css')}}">

{% endblock %}
{% block content %}
{% for msg in get_flashed_messages() %}
<div class="alert alert-success">
	 {{ msg }}
	<button type="button" class="close" data-dismiss="alert" aria-hidden="true">×</button>
</div>

{% endfor %}

<div class="row">
			  <div class="col-md-12">
				  	<div class="panel panel-default">
					  <div class="panel-body">

					  		<table cellpadding="0" cellspacing="0" border="0"
					  		class="table table-bordered">
									<thead>
									<tr>
										<th>id</th>
										<th>URL</th>
										<th>开始时间</th>
										<th>结束时间</th>
										<th>状态</th>
										<th>查看</th>
										<th>删除</th>
									</tr>
								</thead>
								<tbody>
									{% for task in scantasks %}
									<tr >
										<td>{{task.id}}</td>
										<td>{{task.url}}</td>
										<td>{{task.starttime}}</td>
										<td>{{task.endtime}}</td>
										{% if task.status=='SUCCESS' %}
										<td><span class="label label-success">{{task.status}}</span></td>
										{% elif task.status=='PENDING'%}
										<td><span class="label label-default">{{task.status}}</span></td>
										{% elif task.status=='STARTED' %}
										<td><span class="label label-primary">{{task.status}}</span></td>
										{% elif task.status=='PROGRESS' %}
										<td><span class="label label-info">{{task.status}}</span></td>
										{% else %}
										<td><span class="label label-danger">{{task.status}}</span></td>
										{% endif %}
										<td><a href="{{url_for('tasks.scanreport',id=tasks.id,tid=task.tid)}}"><i class="fa fa-sign-in"></i></a></td>
										<td><a href="{{url_for('tasks.deltask',id=tasks.id,tid=task.tid)}}"><i class="fa fa-times"></i></a></td>
									</tr>
								{% endfor %}
								</tbody>
								</table>
							<div style="text-align:center">
								{% import 'scanPages.html' as pg %}
								{{ pg.my_paginate(pagination,'tasks.seetask',tasks.id) }}
							</div>
					  </div>
				  	</div>

			  </div>
            </div>


{% endblock %}
